define([
	'jquery',
	'underscore',
	'backbone',
	'controllers/entryController'
], function($, _, Backbone, EntryController) {
	var AppRouter = Backbone.Router.extend({
		routes: {
			'': 				'mainPage',
			'micro/hot': 		'hotEntries',
			'micro/my': 		'myMicro',
			'micro/entry/:id': 	'entry',
			'micro/profile': 	'profile',
			'@:nick': 			'userProfile',
			'*hashtag': 		'hashTag'
		},
		
		mainPage: function() {
			console.log('mainPage');
		},
		hotEntries: function() {
			console.log('hotEntries');
			
		},
		myMicro: function() {
			console.log('myMicro');
		},
		entry: function(id) {
			console.log('routed to entry/'+id);
			EntryController.showSingleEntry(id);
		},
		userProfile: function(nick) {
			console.log('userProfile; nick = '+nick);
		},
		hashTag: function(hashtag) {
			console.log('hashTag: '+hashtag);
		}
	
	});

	var initialize = function() {
		console.log('appRouter');
		new AppRouter;
		Backbone.history.start();
	};
	return {
		initialize: initialize
	};
});